<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>实名认证详情</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>
    <!-- 当前页面样式 -->
    <link rel="stylesheet" href=<s:url value="/css/common.css"/>>
	<script type="text/javascript" src="<s:url value="/js/jquery-1.9.1.js" />"></script>
	<script type="text/javascript" src="<s:url value="/js/jquery.validate.min.js" />"></script>
	<script type="text/javascript" src="<s:url value="/js/pwms.validate.js" />"></script>
	<script type="text/javascript" src="<s:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
	<script type='text/javascript' src='<s:url value="/js/YLlightbox.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/js/pageAjax.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/js/checkMerinfoinfoCount.js"/>'></script>
	<style>
		 .fieldError { color: red; text-align: left; }
		.error { float: none; color: red;  vertical-align: top;font-size: 11px;}
		#YLimgwrap {
		  position: fixed;
		  left: 0;
		  top: 0;
		  right: 0;
		  bottom: 0;
		  background: rgba(0, 0, 0, 0);
		  z-index: 10;
		  display: none;
		}
	</style>
</head>
<body>

<s:form id="operatorAuthForm" method="POST" onsubmit="return checkForm();" action="/operatorAuthCheck/checkReceive.ct" theme="simple">

<s:hidden id="receiveId" name="receiveId" value="%{#request.operatorAuth.receiveId}"/>

<table class="tb" style="width:100%">
    <tbody>
        <tr class="tb-line">
            <td class="tb-td" colspan="4" ><div class="tb-h3">实名信息审核</div></td>
        </tr>
        <tr class="tb-line">
            <td align="right" class="tb-td" style="width:110px;">
                <div class="tb-h4">账户：</div>
            </td>
            <td class="tb-td" >
             	<label class="tb-input-lengthen">
             	<s:property value="#request.operatorAuth.accountNo"/>
             	<s:if test="#request.operatorAuth.phoneReason != null">
             		<font color="red">
             			（该手机号为黑名单）
             		</font>
             	</s:if>
             	<s:else>
             		<font color="red">
             			（正常）
             		</font>
             	</s:else>
                </label>
            </td>
            <td align="right" class="tb-td" style="width:110px;">
                <div class="tb-h4">真实姓名：</div>
            </td>
            <td class="tb-td" >
             	<label class="tb-input-lengthen">
             	<s:property value="#request.operatorAuth.userName"/>
             	<s:hidden id="realName" name="realName" value="%{#request.operatorAuth.userName}"/>
				</label>
            </td>
        </tr>

        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">证件类型：</div>
            </td>
            <td class="tb-td" >
                <label class="tb-input-lengthen">
                <s:property value="%{#request.operatorAuth.cardType =='01'?'身份证':'其他'}"/> 
				</label>
            </td>
            <td align="right" class="tb-td">
                <div class="tb-h4">证件号码：</div>
            </td>
            <td class="tb-td" colspan="3" >
                <label class="tb-input-lengthen">
                <s:property value="#request.operatorAuth.cardNo"/>
                <s:hidden id="idCard" name="idCard" value="%{#request.operatorAuth.cardNo}"/>
                <s:if test="#request.operatorAuth.idCardReason != null">
             		<font color="red">
             			（该身份证号为黑名单）
             		</font>
             	</s:if>
             	<s:else>
             		<font color="red">
             			（正常）
             		</font>
             	</s:else>
				</label>
            </td>
        </tr>
        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">身份证有效日期：</div>
            </td>
            <td class="tb-td">
            	<s:if test="#request.updateFlag!=null">
            		<input id="startDate"  value="<s:property value="#request.operatorAuth.ext1"/>">
            		<img style="margin-left:-20px" onClick="WdatePicker({el:'startDate',dateFmt:'yyyyMMdd'})"  src="<s:url value="/js/My97DatePicker/skin/datePicker.gif" />" width="16" height="22" /> --
	               	<span id="valueHtml">
					
		               	<%-- <s:if test="#request.operatorAuth.ext2=='长期'">
		               		<input type="hidden" value="0" id="isForLong">
		               		<input id="endDate" disabled="disabled" onfocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});" value="<s:property value="#request.operatorAuth.ext2"/>">
		               	</s:if>
		               	<s:else>
		               		<input type="hidden" value="1" id="isForLong">
		               		<input id="endDate" onfocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});" value="<s:property value="#request.operatorAuth.ext2"/>">
		               	</s:else> --%>
		               	<s:if test="#request.operatorAuth.ext2=='长期'">
		               		<input type="hidden" value="0" id="isForLong">
		               		<input id="endDate" disabled="disabled" value="<s:property value="#request.operatorAuth.ext2"/>">
		               		<img style="margin-left:-20px" onClick="WdatePicker({el:'endDate',dateFmt:'yyyyMMdd'})"  src="<s:url value="/js/My97DatePicker/skin/datePicker.gif" />" width="16" height="22" />
		               	</s:if>
		               	<s:else>
		               		<input type="hidden" value="1" id="isForLong">
		               		<input id="endDate" value="<s:property value="#request.operatorAuth.ext2"/>">
		               		<img style="margin-left:-20px" onClick="WdatePicker({el:'endDate',dateFmt:'yyyyMMdd'})"  src="<s:url value="/js/My97DatePicker/skin/datePicker.gif" />" width="16" height="22" />
		               	</s:else>
	               	</span> 
	               	<input type="button" value='长期有效' id="isForLongButton">
	               	<input type="button" value="修改" id="dataUpdateButton">
            	</s:if>
            	<s:else>
	            	<label class="tb-input-lengthen">
	                	<s:property value="#request.operatorAuth.ext1"/>--<s:property value="#request.operatorAuth.ext2"/>
					</label>
            	</s:else>
            </td>
        </tr>
        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">驳回次数：</div>
            </td>
            <td class="tb-td" >
                <label class="tb-input-lengthen">
                <s:if test="#request.operatorAuth.authReasonList != null">
                	<s:property value="#request.operatorAuth.authReasonList.size()"/>
                </s:if>
                <s:else>
                	0
                </s:else>
				</label>
            </td>
            <td align="right" class="tb-td">
                <div class="tb-h4">驳回原因：</div>
            </td>
            <td class="tb-td" colspan="3" >
               <s:if test="#request.operatorAuth.authReasonList != null">
                <s:iterator value="#request.operatorAuth.authReasonList" var="authReasonList">
                	<s:iterator value="authReasonList" var="authReason">
                		<s:property value="authReason"/>
                	</s:iterator>
                	<br>
                </s:iterator>
                </s:if>
            </td>
        </tr>
		<s:if test="#request.operatorAuth.authPassReasonList != null && #request.operatorAuth.authPassReasonList.size()>0">
			<tr class="tb-line">
				<td align="right" class="tb-td" style="width:130px;">
					<div class="tb-h4">审核通过意见：</div>
				</td>
				<td class="tb-td" colspan="3">
					<s:iterator value="#request.operatorAuth.authPassReasonList" var="passReasonList">
					<s:iterator value="passReasonList" var="authpReason">
						<s:property value="authpReason"/>
					</s:iterator>
					<br>
					</s:iterator>
				</td>
			</tr>
		</s:if>
		<s:if test="#request.operatorAuth.ext5 != null">
			<tr class="tb-line">
				<td align="right" class="tb-td" style="width:130px;">
					<div class="tb-h4">限制理由：</div>
				</td>
				<td class="tb-td">
					<s:if test="#request.operatorAuth.limitReasonList != null">
						<s:iterator value="#request.operatorAuth.limitReasonList" var="limitReasonList">
							<s:iterator value="limitReasonList" var="limitReason">
								<s:property value="limitReason"/>
							</s:iterator>
							<br>
						</s:iterator>
					</s:if>
				</td>
			</tr>
		</s:if>
		<s:if test="#request.operatorAuth.ext3 != null">
			<tr class="tb-line">
				<td align="right" class="tb-td">
					<div class="tb-h4">解限备注：</div>
				</td>
				<td class="tb-td" colspan="3">
					<label class="tb-input-lengthen">
						<s:property value="#request.operatorAuth.ext3"/>
					</label>
				</td>
			</tr>
		</s:if>
        <tr class="tb-line">
        	<td  class="tb-td" colspan="4" style="padding:0;">
        		<table style="width: 100%" class="tb-pic YLlightbox" >
        			<tr class="tb-line">
        				<td class="tb-td" style="padding:5px 0;border:1px solid #e2dfdf;">
        					<label class="pic-uploading">
	        					<a rel="YLlightbox" href="showPhone.ct?accountNo=<s:property value="#request.operatorAuth.accountNo"/>&fileName=<s:property value="#request.operatorAuth.frontImage"/>"  style="display: block;"  >
								         <img   src="showPhone.ct?accountNo=<s:property value="#request.operatorAuth.accountNo"/>&fileName=<s:property value="#request.operatorAuth.frontImage"/>">
								</a>
							</label>
							<div align="center">身份证正面照片</div>
        				</td>
        				<td class="tb-td" style="padding:5px 0;border:1px solid #e2dfdf;">
        					<label class="pic-uploading">
	        					<a rel="YLlightbox" href="showPhone.ct?accountNo=<s:property value="#request.operatorAuth.accountNo"/>&fileName=<s:property value="#request.operatorAuth.revereImage"/>"  style="display: block;" >
								      <img   src="showPhone.ct?accountNo=<s:property value="#request.operatorAuth.accountNo"/>&fileName=<s:property value="#request.operatorAuth.revereImage"/>">
								</a> 
							</label>
							<div align="center">身份证反面照片</div>
        				</td>
        				<td class="tb-td" style="padding:5px 0;border:1px solid #e2dfdf;">
        					<label class="pic-uploading">
	        					<a rel="YLlightbox" href="showPhone.ct?accountNo=<s:property value="#request.operatorAuth.accountNo"/>&fileName=<s:property value="#request.operatorAuth.handleImage"/>"  style="display: block;" >
								      <img   src="showPhone.ct?accountNo=<s:property value="#request.operatorAuth.accountNo"/>&fileName=<s:property value="#request.operatorAuth.handleImage"/>">
								</a> 
							</label>
							<div align="center">手持身份证正面照片</div>
        				</td>
        				<td class="tb-td" style="padding:5px 0;border:1px solid #e2dfdf;">
        					<label class="pic-uploading">
	        					<a rel="YLlightbox" href="showPhone.ct?accountNo=<s:property value="#request.operatorAuth.accountNo"/>&fileName=<s:property value="#request.operatorAuth.handleReverseImage"/>"  style="display: block;" >
								      <img   src="showPhone.ct?accountNo=<s:property value="#request.operatorAuth.accountNo"/>&fileName=<s:property value="#request.operatorAuth.handleReverseImage"/>">
								</a> 
							</label>
							<div align="center">手持身份证反面照片</div>
        				</td>
        			</tr>
        			<s:if test="#request.operatorAuth.ext4 != null">
        				<tr class="tb-line">
							<td class="tb-td" style="padding:5px 0;border:1px solid #e2dfdf;">
	        					<label class="pic-uploading">
		        					<a rel="YLlightbox" href="showPhone.ct?accountNo=<s:property value="#request.operatorAuth.accountNo"/>&fileName=<s:property value="#request.operatorAuth.ext4"/>"  style="display: block;" >
										<img style="height:100%;" src="showPhone.ct?accountNo=<s:property value="#request.operatorAuth.accountNo"/>&fileName=<s:property value="#request.operatorAuth.ext4"/>">
									</a> 
								</label>
								<div align="center">担保函照片</div>
	        				</td>
						</tr>
        			</s:if>
        		</table>
        	</td>
        </tr>
             	 
    </tbody>
</table>
	<div align="center" class="line-submit bg-gray">
		<label class="tb-input-submit">
	   		 <input id="backBtn" type="button" value="返回" onclick="history.back()"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	   	</label>
    </div>
  
</s:form> 
</body>

<script>
	var currentTerNum=1;
    $(function () {
		$("#YLimgwrap").bind("click",function(e){ 
			var target = $(e.target); 
			if(target.closest("#YLimgcon").length == 0){ 
				$(".YLt_close").trigger("click");
			} 
		}); 
		
		$("#isForLongButton").click(function(){
      		if($("#isForLong").val()=="0"){
      			$("#endDate").attr("disabled",false);
      			$("#isForLong").val("1");
      			$("#endDate").val("");
      		}else if($("#isForLong").val()=="1"){
      			$("#endDate").attr("disabled",true);
      			$("#isForLong").val("0");
      			$("#endDate").val("长期");
      		}
      	});
		
		$("#dataUpdateButton").click(function(){
			var endDate = "长期";
			if($("#isForLong").val()=="1"){
				endDate = $("#endDate").val();
			}
			var startDate = $("#startDate").val();
			var receiveId = $("#receiveId").val();
			var reg=  /^(?:(?!0000)[0-9]{4}(?:(?:0[1-9]|1[0-2])(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])(?:29|30)|(?:0[13578]|1[02])31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)0229)$/; 
			if(!reg.test(startDate)){
				 alert("开始日期格式不正确，正确格式为：yyyymmdd");  
				 return false;
			}
			if(endDate != "长期"&&!reg.test(endDate)){
				alert("结束日期格式不正确，正确格式为：yyyymmdd");  
				return false;
			}
			$.ajax({
				url:"<%=basePath%>operatorAuthCheck/updateIdCardDate.ct",
				type:"post",
				data:{"receiveId":receiveId,"startDate":startDate,"endDate":endDate},
				dataType:"json",
				success:function(result){
					var msgCode = result.msgCode;
					if(msgCode == "0000"){
						alert("修改成功");
					}else{
						alert("修改失败");
					}
					
				},error:function(){
					alert("未知错误！");
				}
			});
		});
      	
    }); 
</script>
</html>
